package tp.pr2;

public class Garbage extends Item{
	
    private int recycledMaterial;
    private boolean used;

	public Garbage(java.lang.String id,
		       java.lang.String description,
		       int recycledMaterial)
	{
		super(id,description);
		this.recycledMaterial=recycledMaterial;
		used=true;
	}
	
	public boolean canBeUsed()
	{
		return  used;
	}
			
	public boolean use(RobotEngine r, Place p)
	{
		if(!used)return false;
		r.addRecycledMaterial(recycledMaterial);
		System.out.println(r.statsToString());
		used=false;
		return true;		
	}
	
	public java.lang.String toString()
	{
	 return super.toString()+"// recycled material = "+recycledMaterial;
	}
}
